# sudo docker build -t registry.lglab.ac.cn/tensorflow/tensorflow:2.16.2-gpu-jupyter-ssh .
FROM tensorflow/tensorflow:2.16.2-gpu-jupyter
RUN apt-get update \
 && apt-get install -y openssh-server supervisor \
 && apt-get clean

#RUN echo 'root:P@88w0rd' | chpasswd

ARG SSH_PUBKEY="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCgaeyBXrClxTEc+Tt3VBkNGqHI47gUZYXCxOZcUyeO1CQMkIoq7z7B6PoPJKuN34Dn9l4JtyFcqxfqes4MDVLmlnP4U7xjasebfN7bhZ8Wos2kJx/5IyDnTByD8ZHxfzjczI0Ld2Bl+fZHlNFERS1KKMhg6NFpfuuRmOleFOVE+fmqYa8GnanWd0EEfY7rzvYLLePYRHZwxCunKJ2aF0KW4zHRxCSlTgvuFchawgU7Nf9wLSL3ZMTqiMPvATH8/4O4+51j0tDGLeh+3GPtIDUHyoDn2FN1+3WqPM2FvW7NhXdpYa3aknqtx3as2gVglb1aVSFOQ3Dt83LQyZSjcJvVJd2VAuAleiaQX+HabVApnExFoDZ9QLrFlNvjHgTrhtQGiy/7kyVZlWJMcCmkExLBLBp/moUTpi8+3/Fern5So8DcToX2qhsUSj8SAEaKmZyYOkWinFMrCAxtMcD1CD56tL7mjjLLO4m8tAAnRu7+o44CTxYvpsg98fLELtrRDm8= lgadmin@Telecom-HPC-N01"
RUN mkdir -p /root/.ssh && \
    echo "${SSH_PUBKEY}" >> /root/.ssh/authorized_keys && \
    chmod 700 /root/.ssh && \
    chmod 600 /root/.ssh/authorized_keys

COPY supervisord.conf /etc/supervisor/supervisord.conf
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
WORKDIR /workspace/
ENTRYPOINT ["/entrypoint.sh"]

